# create by fanfan on 2020/3/31 0031
from kashgari.corpus import ChineseDailyNerCorpus
from kashgari.tasks.labeling import BiLSTM_Model
from kashgari.embeddings.bert_embedding import BERTEmbedding
train_x,train_y = ChineseDailyNerCorpus.load_data('train')
test_x,test_y = ChineseDailyNerCorpus.load_data('test')
valid_x,valid_y = ChineseDailyNerCorpus.load_data('valid')

embedding = BERTEmbedding(model_folder = r"E:\nlp-data\bert\model_uncase")

model = BiLSTM_Model(embedding)
model.fit(train_x,train_y,valid_x,valid_y,epochs=10)